<!DOCTYPE html>
<html lang="en">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<meta http-equiv="X-UA-Compatible" content="ie=edge" />
		<meta name="author" content="xiaojiangK" />
		<meta name="email" content="740092856@qq.com" />
		<meta name="gitee" content="https://gitee.com/xiaojiangk/" />
		<meta name="viewport" content="width=1200, initial-scale=1.0" />
		<link rel="stylesheet" type="text/css" href="images/css/admin.min.css" />
		<link rel="shortcut icon" href="images/logo.png" type="image/x-icon" />
		<title>admin-radio</title>
	</head>
	<body>
		<div class="demo-main">
			<div class="admim-title">
				<h2>Radio 单选框</h2>
				<p>在一组备选项中进行单选</p>
			</div>
			<div class="item">
				<div class="title">
					<h3>基础用法</h3>
					<p>由于选项默认可见，不宜过多，若选项过多，建议使用 Select 选择器。</p>
				</div>
				<div class="content">
					<qx-radio name="sex" value="0">备选项</qx-radio>
					<qx-radio name="sex" value="1">备选项</qx-radio>
				</div>
			</div>
			<div class="item">
				<div class="title">
					<h3>带默认值</h3>
					<p>Radio 单选框默认选中状态。</p>
				</div>
				<div class="content">
					<qx-radio value="0" checked>默认选中</qx-radio>
					<qx-radio value="1">备选项</qx-radio>
				</div>
			</div>
			<div class="item">
				<div class="title">
					<h3>禁用状态</h3>
					<p>Radio 单选框不可用的状态。</p>
				</div>
				<div class="content">
					<qx-radio disabled value="0">禁用</qx-radio>
					<qx-radio checked disabled value="1">选中且禁用</qx-radio>
				</div>
			</div>
			<div class="item">
				<div class="title">
					<h3>按钮样式</h3>
					<p>按钮样式的单选组合。</p>
				</div>
				<div class="content">
					<div class="group">
						<qx-radio button checked value="0">北京</qx-radio>
						<qx-radio button value="1">上海</qx-radio>
						<qx-radio button value="2">广州</qx-radio>
						<qx-radio button value="3">深圳</qx-radio>
					</div>
					<div class="group">
						<qx-radio button disabled size="medium" value="0">北京</qx-radio>
						<qx-radio button size="medium" value="1">上海</qx-radio>
						<qx-radio button size="medium" value="2">广州</qx-radio>
						<qx-radio button size="medium" value="3">深圳</qx-radio>
					</div>
					<div class="group">
						<qx-radio button checked size="small" disabled value="0">北京</qx-radio>
						<qx-radio button size="small" value="1">上海</qx-radio>
						<qx-radio button size="small" value="2">广州</qx-radio>
						<qx-radio button size="small" value="3">深圳</qx-radio>
					</div>
					<div class="group">
						<qx-radio button size="mini" value="0">北京</qx-radio>
						<qx-radio button size="mini" value="1">上海</qx-radio>
						<qx-radio button size="mini" value="2">广州</qx-radio>
						<qx-radio button size="mini" value="3">深圳</qx-radio>
					</div>
				</div>
			</div>
			<div class="item">
				<div class="title">
					<h3>带有边框</h3>
					<p>按钮样式带有边框。</p>
				</div>
				<div class="content">
					<div class="group">
						<qx-radio bordered checked value="0">备选项</qx-radio>
						<qx-radio bordered value="1">备选项</qx-radio>
						<qx-radio bordered value="2">备选项</qx-radio>
					</div>
					<div class="group">
						<qx-radio bordered disabled size="medium" value="0">备选项</qx-radio>
						<qx-radio bordered size="medium" value="1">备选项</qx-radio>
						<qx-radio bordered size="medium" value="2">备选项</qx-radio>
					</div>
					<div class="group">
						<qx-radio bordered checked size="small" disabled value="0">备选项</qx-radio>
						<qx-radio bordered size="small" value="1">备选项</qx-radio>
						<qx-radio bordered size="small" value="2">备选项</qx-radio>
					</div>
					<div class="group">
						<qx-radio bordered size="mini" value="0">备选项</qx-radio>
						<qx-radio bordered size="mini" value="1">备选项</qx-radio>
						<qx-radio bordered size="mini" value="2">备选项</qx-radio>
					</div>
				</div>
			</div>
		</div>

		<div class="attributes">
			<h2>Radio Attributes</h2>
			<table>
				<thead>
					<tr>
						<th>参数</th>
						<th>说明</th>
						<th>类型</th>
						<th>可选值</th>
						<th>默认值</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>checked</td>
						<td>当前是否勾选</td>
						<td>boolean</td>
						<td>—</td>
						<td>false</td>
					</tr>
					<tr>
						<td>label</td>
						<td>Radio 的 value</td>
						<td>string / number / boolean</td>
						<td>—</td>
						<td>—</td>
					</tr>
					<tr>
						<td>disabled</td>
						<td>是否禁用</td>
						<td>boolean</td>
						<td>—</td>
						<td>false</td>
					</tr>
					<tr>
						<td>bordered</td>
						<td>是否显示边框</td>
						<td>boolean</td>
						<td>—</td>
						<td>false</td>
					</tr>
					<tr>
						<td>button</td>
						<td>是否显示按钮</td>
						<td>boolean</td>
						<td>—</td>
						<td>false</td>
					</tr>
					<tr>
						<td>size</td>
						<td>Radio 的尺寸，仅在 bordered / button 为真时有效</td>
						<td>string</td>
						<td>medium / small / mini</td>
						<td>—</td>
					</tr>
					<tr>
						<td>name</td>
						<td>原生 name 属性</td>
						<td>string</td>
						<td>—</td>
						<td>—</td>
					</tr>
				</tbody>
			</table>
			<h2>Radio Events</h2>
			<table>
				<thead>
					<tr>
						<th>事件名称</th>
						<th>说明</th>
						<th>回调参数</th>
					</tr>
				</thead>
				<tbody>
					<tr>
						<td>change</td>
						<td>绑定值变化时触发的事件</td>
						<td>选中的 Radio value 值</td>
					</tr>
				</tbody>
			</table>
		</div>

		<script src="images/js/jquery.min.js"></script>
		<script src="images/js/admin.min.js"></script>
		<script>
			$(function () {
				$('.demo-main').radio({
					change: function (val) {
						console.log(val)
					}
				})
			})
		</script>
	</body>
</html>
